<?php
    use yii\helpers\Url;
    $this->inline("title","SEO优化 网站设置");
?>
<div class="panel">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-12">
                <div class="card-box">
                    <h4 class="m-t-0 m-b-30 header-title"><b>SEO优化设置</b></h4>
                    <p class="text-muted font-13 m-b-30">
                        爱生活、爱分享！
                    </p>

                    <form method="post" action="<?=Url::toRoute('sysconfig/update')?>" data-parsley-validate novalidate>
                        <input type="hidden" name="<?=Yii::$app->request->csrfParam?>" value="<?=Yii::$app->request->csrfToken?>">
                        <?php if (isset($seo['id'])):?>
                            <input type="hidden" name="id" value="<?=isset($seo['id']) ? $seo['id'] : '';?>">
                        <?php endif;?>
                        <div class="form-group">
                            <label>标 题</label>
                            <input type="text" name="title" class="form-control" value="<?=isset($seo['title']) ? $seo['title'] : '';?>" parsley-trigger="change" required autofocus placeholder="网站标题" />
                        </div>
                        <div class="form-group">
                            <label>关键字</label>
                            <input type="text" name="keywords" class="form-control" value="<?=isset($seo['keywords']) ? $seo['keywords'] : '';?>" parsley-trigger="change" required autofocus placeholder="关键字" />
                        </div>
                        <div class="form-group">
                            <label>描 述</label>
                            <textarea name="desc" class="form-control" parsley-trigger="change" required autofocus><?=isset($seo['desc']) ? $seo['desc'] : '';?></textarea>
                        </div>
                        <div class="form-group">
                            <label>版 权</label>
                            <input type="text" name="copyright" class="form-control" value="<?=isset($seo['copyright']) ? $seo['copyright'] : '';?>" required placeholder="xxshare | 慕梓网络" parsley-trigger="change" required autofocus/>
                        </div>
                        <div class="form-group">
                            <label>备案号</label>
                            <input type="text" name="recnumber" value="<?=isset($seo['recnumber']) ? $seo['recnumber'] : '';?>" class="form-control" placeholder="京 备ICP 88888888" parsley-trigger="change" required autofocus/>
                        </div>
                        <div class="form-group">
                            <label>网站宗旨</label>
                            <textarea name="motto" required class="form-control" parsley-trigger="change" required autofocus><?=isset($seo['motto']) ? $seo['motto'] : ''?></textarea>
                        </div>
                        <div class="form-group text-right m-b-0">
                            <button type="submit" class="btn btn-primary waves-effect waves-light">
                                保存
                            </button>
                            <!--<button onclick="location.href='<?/*=Url::toRoute('/sysconfig/seo')*/?>'" class="btn btn-default waves-effect m-l-5">
                                取消
                            </button>-->
                        </div>
                    </form>
                </div>
            </div>
        </div> 
    </div>
</div>

<?php $this->beginBlock("jsText");?>
<script type="text/javascript">
    $(document).ready(function() {
        $('form').parsley();
    });
</script>
<?php $this->endBlock();?>